package light.head.config;

import light.head.constant.Parm;



public class ConfigParm {

	private static Integer pageSize = null;
	private static Boolean recordLog = null;
	private static String contextPath = null;
	private static String projectPath = null;
	private static Integer cacheNoticeTotal = null;
	
	private static String messageServer = null;
	private static String messageUname = null;
	private static String messagePwd = null;
	private static String messageName = null;


















	public static boolean loadConfigParm() {
		if (null == Config.getConfig())
			Config.loadConfig();
		
		pageSize = Integer.parseInt(Config.getConfig().get(Parm.PAGE_SIZE).toString());
		recordLog = Boolean.parseBoolean(Config.getConfig().get(Parm.RECORD_LOG).toString());
		contextPath = Config.getConfig().get(Parm.CONTEXT_PATH).toString();
		projectPath = Config.getConfig().get(Parm.PROJECT_PATH).toString();
		cacheNoticeTotal = Integer.parseInt(Config.getConfig().get(Parm.CACHE_NOTICE_TOTAL).toString());

		messageServer = Config.getConfig().get(Parm.MESSAGE_SERVER).toString();
		messageUname = Config.getConfig().get(Parm.MESSAGE_UNAME).toString();
		messagePwd = Config.getConfig().get(Parm.MESSAGE_PWD).toString();
		messageName = Config.getConfig().get(Parm.MESSAGE_NAME).toString();
		
		return true;
	}

	
	
	
	
	
	
	
	
	public static Integer getPageSize() {
		if (null == pageSize)
			loadConfigParm();
		return pageSize;
	}
	public static Boolean getRecordLog() {
		if (null == recordLog)
			loadConfigParm();
		return recordLog;
	}
	public static String getContextPath() {
		if (null == contextPath)
			loadConfigParm();
		return contextPath;
	}
	public static String getProjectPath() {
		if (null == projectPath)
			loadConfigParm();
		return projectPath;
	}
	public static Integer getCacheNoticeTotal() {
		if (null == cacheNoticeTotal)
			loadConfigParm();
		return cacheNoticeTotal;
	}


	public static String getMessageServer() {
		if (null == messageServer)
			loadConfigParm();
		return messageServer;
	}



	public static String getMessageUname() {
		if (null == messageUname)
			loadConfigParm();
		return messageUname;
	}



	public static String getMessagePwd() {
		if (null == messagePwd)
			loadConfigParm();
		return messagePwd;
	}


	public static String getMessageName() {
		if (null == messageName)
			loadConfigParm();
		return messageName;
	}


}
